package com.siam.package_mall.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import com.siam.package_common.entity.BasicResult;
import com.siam.package_mall.entity.PointsMallCouponsMemberRelation;
import com.siam.package_mall.service.PointsMallCouponsMemberRelationService;

@RestController
public class PointsMallCouponsMemberRelationFeignProvider implements PointsMallCouponsMemberRelationFeignApi{
	
	@Autowired
	private PointsMallCouponsMemberRelationService couponsMemberRelationService;

	@Override
	public BasicResult insertSelective(PointsMallCouponsMemberRelation record) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public BasicResult updateOverdue() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public BasicResult updateCouponsUsed(Integer id, Boolean isUsed) {
		// TODO Auto-generated method stub
		couponsMemberRelationService.updateCouponsUsed(id, isUsed);
		return BasicResult.success();
	}

	@Override
	public BasicResult<PointsMallCouponsMemberRelation> selectPointsMallCouponsMemberRelationByPrimaryKey(Integer id) {
		return BasicResult.success(couponsMemberRelationService.selectPointsMallCouponsMemberRelationByPrimaryKey(id));
	}

	@Override
	public BasicResult<Integer> getCountsByMemberId(Integer memberId) {
		Integer counts = couponsMemberRelationService.getCountsByMemberId(memberId);
		return BasicResult.success(counts);
	}

}
